<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
    
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>review update</title>
<script type="text/javascript">
	function check1(){
		if(document.review.pr_title.value==""){
			alert("제목을 입력하세요!");
			return false;
		}
		if(document.review.pr_content.value==""){
			alert("내용을 입력하세요!");
			return false;
		}	
	}
</script>
</head>
<body>
	<h1>상품 리뷰 수정</h1>
	<form action="reviewUpdate.do" enctype="multipart/form-data" method="POST" name="review" onsubmit="return check1()">
			<input type="hidden" value="${member.p_code}" name="p_code">
			<table width="600" border="0">
				<tr>
					<td bgcolor="#777777" colspan="2" height="2"></td>
				</tr>
				<tr>
					<td width="100" bgcolor="#f4f4f4">
						<font color="#ff0000">*</font>
						제목
					</td>
					<td width="500">
						<input type="text" maxlength="20" name="pr_title" size="40" value="${member.pr_title}">
					</td>
				</tr>
				<tr>
					<td bgcolor="#777777" colspan="2" height="2"></td>
				</tr>
				<tr>
					<td width="100" bgcolor="#f4f4f4">
						아이디
					</td>
					<td width="500">
						${member.userid}
					</td>
				</tr>
				<tr>
					<td bgcolor="#777777" colspan="2" height="2"></td>
				</tr>
				<tr>
					<td width="100" bgcolor="#f4f4f4">
						암호
					</td>
					<td width="500">
						<input type="password" name="pr_passwd" value=""${member.pr_passwd}>
					</td>
				</tr>
				<tr>
					<td bgcolor="#777777" colspan="2" height="2"></td>
				</tr>
				<tr>
					<td width="100" bgcolor="#f4f4f4">
						<font color="#ff0000">*</font>
						내용
					</td>
					<td width="500">
						<textarea cols="50"  rows="8" name="pr_content">${member.pr_content}</textarea>
					
					</td>
				</tr>
				<tr>
					<td bgcolor="#777777" colspan="2" height="2"></td>
				</tr>
				<tr>
					<td width="100" bgcolor="#f4f4f4">
						사진 
					</td>
					<td width="500">
						<input type="file" name="upload">
						<c:choose>
						<c:when test="${member.pr_image != null}">
						${member.pr_image}
						</c:when>
						<c:otherwise>
						등록된 사진이 없습니다.
						</c:otherwise>		
						</c:choose>
					</td>
				</tr>
				<tr>
					<td height="10" colspan="2"></td>
				</tr>
				<tr>
					<td align="right" colspan="2">
						<input type="submit" value="전송">
						<input type="button" value="취소" onclick="javascript:history.back()">
				</tr>
			</table>
		</form>
</body>
</html>    